import request from '@/utils/request';

export async function getTemplateInspectionItemByPage (params: any) {
    return request('/api/quality/getTemplateInspectionItemByPage', {
    method: 'POST',
    data: params,
  });
}

export async function addTemplateInspectionItem (params: any) {
    return request('/api/quality/addTemplateInspectionItem', {
    method: 'POST',
    data: params,
  });
}

export async function updateTemplateInspectionItem (params: any) {
    return request('/api/quality/updateTemplateInspectionItem', {
    method: 'POST',
    data: params,
  });
}

export async function delTemplateInspectionItem (params: any) {
    return request('/api/quality/delTemplateInspectionItem', {
    method: 'POST',
    data: params,
  });
}

export async function exportTemplateInspectionItem(params: any) {
    return request('/api/quality/exportTemplateInspectionItem', {
    method: 'POST',
    data: params,
    responseType: 'blob',
  });
}

// 新建排序去重
export async function getTemplateInspectionItemBySortId (para: any) {
  return request('/api/quality/getTemplateInspectionItemBySortId', {
  method: 'POST',
  data: para,
  params: {
    inspectionTemplateId: para.inspectionTemplateId,
    sortId: para.sortId,
  },
});
}
export default { getTemplateInspectionItemByPage, addTemplateInspectionItem, updateTemplateInspectionItem, delTemplateInspectionItem, exportTemplateInspectionItem }
